home *** CD-ROM | disk | FTP | other *** search
/ C & C++ Multimedia Cyber Classroom / C and C++ Multimedia Cyber Classroom (Prentice Hall) (1998).iso / src / fig03_25.jar / Ch03 / Fig03_25 / Fig03_25.cpp
C/C++ Source or Header  |  1997-10-11  |  350b  |  18 lines

  1. // Fig. 3.25: fig03_25.cpp
  2. // Using overloaded functions
  3. #include <iostream.h>
  4.  
  5. int square( int x ) { return x * x; }
  6.  
  7. double square( double y ) { return y * y; }
  8.  
  9. int main()
  10. {
  11.    cout << "The square of integer 7 is " << square( 7 )
  12.         << "\nThe square of double 7.5 is " << square( 7.5 ) 
  13.         << endl;    
  14.  
  15.    return 0;
  16. }
  17.  
  18.